#ifndef KWDB_SDK_CLIENT_IMPL_H
#define KWDB_SDK_CLIENT_IMPL_H

#include "kwdb/client.h"
#include "kwdb/config.h"
#include "kwdb/status.h"
#include "transport.h"
#include <grpcpp/grpcpp.h>
#include <memory>

namespace kwdb {

/**
 * @brief PIMPL implementation class for KwdbClient
 *
 * Hides gRPC dependencies from public header
 */
class KwdbClientImpl {
public:
    explicit KwdbClientImpl(const IngestConfig& config);
    ~KwdbClientImpl() = default;

    Status write(const Point& point);
    Status batch_write(const std::vector<Point>& points);
    Status query(const std::string& sql, std::vector<std::vector<std::string>>& rows);

private:
    IngestConfig config_;
    std::shared_ptr<grpc::Channel> channel_;
    std::unique_ptr<kwdb::ingest::v1::IngestService::Stub> stub_;
    std::unique_ptr<kwdb::ingest::v1::QueryService::Stub> query_stub_;
};

} // namespace kwdb

#endif // KWDB_SDK_CLIENT_IMPL_H